$("#act_register").click(function(){
   var userdata={
       "userID": $("#form_register input[name=studentID]").val(),
       "username": $("#form_register input[name=username]").val(),
       "userpassword": $("#form_register input[name=password]").val(),
       "useremail": $("#form_register input[name=email]").val()
   };
    userdata = JSON.stringify(userdata);

   $.ajax({
       url: "/act_register",
       type: "POST",
       contentType: 'application/json; charset=UTF-8',
       data: userdata,
       success: function(errorID){
          switch(errorID){
             case '0':
                window.alert("注册失败");
                break;
             case '1':
                window.alert("注册成功");
                window.location.href = "/";
                break;
             default:
                window.alert("系统错误");
          }
       },
       error: function() {
           window.alert("连接失败");
       }
   });
});